$(function(){
	$(".menu_list").find(".lion").removeClass("lion");
	//$(".menu_list").find("li:eq(1)").addClass("lion");
	$("#usermanager").addClass("lion");

});
function update(userId){
	
	if(!verifyInputField("loginName,realName,address"))
		return ;
	if(!checkLoginName("loginName"))
		return ;	
	/*
	if($("#attachmentFileName").val() == ""){
		alertMsg("请上传图像!");
		return;
	}
	
	if(!isPhone("msisdn")){
		return ;
	}
	
	if(!isEmail("email")){
		return ;
	}
	*/
	var user = {
		id:userId,
		loginName:$("#loginName").val(),
		nickName:$("#nickName").val(),
		//msisdn:$("#msisdn").val(),
		//email:$("#email").val(),
		realName:$("#realName").val(),
		idCard:$("#idCard").val(),
		address:$("#address").val(),
		headImg : $("#attachmentFileName").val()
	};
	$.ajax({
	   type: "POST",
	   url: "usercenter/subaccounts/checkSubAccount",
	   dataType:"json",
	   data:JSON.stringify(user),
	   contentType:"application/json;charset=UTF-8",
	   success: function(data){
				   		if(data.result == true){
							alertMsg("登录帐号已存在！");
					   		}else{
					   		  	$.ajax({
								   type: "POST",
								   url: "usercenter/usermanager/update",
								   dataType:"json",
								   data:JSON.stringify(user),
								   contentType:"application/json;charset=UTF-8",
								   success: function(data){
								   		if(data.result === true){
								   			alertMsg("修改成功!");
								   		}else{
								   			alertMsg("修改失败，"+data.result+"!");
								   		}
							   	   }
								});
		   		}
   	   }
	});	
	

}